package com.liuzhilong.infrastructure.basic.strategy;

import com.liuzhilong.infrastructure.basic.strategy.simple.Invoker;
import com.liuzhilong.infrastructure.basic.strategy.simple.impl.StrategyDemo1;
import com.liuzhilong.infrastructure.basic.strategy.simple.impl.StrategyDemo2;

public class UseCase {
    public static void main(String[] args) {
        userSimple();
    }
    public static final void userSimple(){
        Invoker invoker = new Invoker();
        //设置策略1
        invoker.changeStrategy(StrategyDemo1.create());
        invoker.logic();
        //变更策略2
        invoker.changeStrategy(StrategyDemo2.create());
        invoker.logic();
    }
}
